package com.example.demo.controller.netty;

import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author 高俊
 * @create 2022-03-2022/3/4-13:24
 */
public class Services {
    public static void main(String[] args) throws Exception {
        ServerSocket serverSocket = new ServerSocket(9090);
        while (true){
            Socket socket = serverSocket.accept();
            System.out.println("xxx连接来了");

            byte[] bytes = new byte[1024];
            socket.getInputStream().read(bytes);
            System.out.println("收到客户端消息" + new String(bytes));
        }
    }
}
